package cn.fsd.exception;

import cn.fsd.vo.ResultBean;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class CustomerExceptionHandler {
    @SuppressWarnings("rawtypes")
    @ExceptionHandler(value = {CustomerException.class})
    @ResponseBody
    public <T> ResultBean exceptionHandler(CustomerException e){
        return ResultBean.error(e.getCode(),e.getMsg());
    }
}
